package org.anderground.editor.storage;

import java.util.LinkedList;
import java.util.List;

import org.anderground.core.storage.ModelWriter;

public class WritersRegistry {

	private static List<FileFormat> formats = new LinkedList<FileFormat>();

	public static class FileFormat {
		public String shortFileFormatDescription;
		public String formatFileNameExtension;
		public Class<ModelWriter> writerClass;

		FileFormat(String shortFormatDescription, String fileExtension,
				Class<ModelWriter> writerClass) {
			this.shortFileFormatDescription = shortFormatDescription;
			this.formatFileNameExtension = fileExtension;
			this.writerClass = writerClass;
		}
	}

	public static void addSaver(String shortFormatDescription,
			String fileExtension, Class<ModelWriter> writerClass) {
		formats.add(new FileFormat(shortFormatDescription, fileExtension,
				writerClass));
	}

	public static List<FileFormat> getFormats() {
		return formats;
	}
}
